<template>
  <van-form>
    <van-cell-group inset>
      <van-field
        v-model="celsius"
        type="number"
        label="℃"
        @blur="celsiusToFahrenheit"
      />
      <van-field
        v-model="fahrenheit"
        type="number"
        label="℉"
        @blur="fahrenheitToCelsius"
      />
    </van-cell-group>
    <div style="margin: 16px">
      <van-button round block type="primary"> 转换 </van-button>
    </div>
  </van-form>
</template>

<script setup>
import { useTemperature } from './useTemperature.js';

const { celsius, fahrenheit, celsiusToFahrenheit, fahrenheitToCelsius } =
  useTemperature();
</script>
